#include <iostream>

using namespace std;

#include <stdio.h>
class Solution 
{
public:
    vector<string> ret;
    int n;
    void dfs(string& s, string& path, string& ans, int index, int k)
    {
        if (k > 5 && index < n) return;
        if (index == n)
        {
            if (k == 4) ret.emplace_back(ans);
            else return;
        }

    }
    vector<string> restoreIpAddresses(string s)
    {
        n = s.size();
        if (n > 12) return {};
        string path, ans;
        dfs(s, path, ans, 0, 0);
        return ret;
    }
};
